package leafedbox.events
{
	import leafedbox.commands.Command;
	import flash.events.Event;

	/**
	 * This class represents an event used by <code>Command</code> objects.
	 */
	public class CommandEvent extends Event
	{
		//--------------------------------------------------------------------------
		// Static Constants
		//--------------------------------------------------------------------------
		
		static public const INVOKE : String = "commandInvoke";

		static public const RESULT : String = "commandResult";

		static public const FAULT  : String = "commandFault";
		

		//--------------------------------------------------------------------------
		// Constructor
		//--------------------------------------------------------------------------
	
		/**
		 * Constructor.
		 */
		public function CommandEvent(type:String, bubbles:Boolean=false,
									 cancelable:Boolean=true, command:Command=null):void
		{
			super(type, bubbles, cancelable);
			this.command = command;
		}


		//--------------------------------------------------------------------------
		// Properties
		//--------------------------------------------------------------------------
	
		/**
		 * The command that this event is attached to.
		 */
		public var command : Command;

	}

}